home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / cp1.zip / SOUND.ASM < prev    next >
Assembly Source File  |  1993-05-29  |  4KB  |  85 lines

  1. ===========================================================================
  2.  BBS: The Abacus * HST/DS * Potterville MI
  3. Date: 05-25-93 (07:00)             Number: 134
  4. From: LUIS ESPINOZA                Refer#: 255
  5.   To: LES FENISON                   Recvd: NO  
  6. Subj: Borland C++ For OS/2           Conf: (36) C Language
  7. ---------------------------------------------------------------------------
  8. On (21 May 93) Les Fenison wrote to All...
  9.  
  10.  LF> Hello All!
  11.  LF>
  12.  LF> I recently purchased BC/2 and have many questions.  I called Borland
  13.  LF> tech support only to find out that their tech support people arn't the
  14.  LF> least bit technical.  I would be suprised if they knew the difference
  15.  LF> between C and Basic!  So... hopefully someone here can answer these
  16.  LF> questions...
  17.  LF>
  18.  LF> 1. Borland says it is impossible to make the pc speaker beep when you
  19.  LF> are
  20.  LF>    programming in OS/2 C.  I don't buy this!!  Can anyone tell me how
  21.  LF> to
  22.  LF>    do it??   I know there is no longer a sound() and nosound() but
  23.  LF> there
  24.  LF>    has to be a way since I have seen several programs in OS/2 that do.
  25.  LF>    The application is a non-PM application.
  26.  
  27.         Ya, no I got bored one day and thought I would Disassemble the
  28.         sound/nosound routines.
  29.         Here is what they look like:
  30.                                                 Hope It Helps,
  31.                                                 Luis Espinoza
  32.  
  33.  
  34.  
  35. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  36. ;                              SUBROUTINE
  37. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  38.  
  39. Sound   proc    near
  40.                 push    bp
  41.                 mov     bp,sp
  42.                 mov     bx,[bp+4]
  43.                 mov     ax,34DDh
  44.                 mov     dx,12h
  45.                 cmp     dx,bx
  46.                 jae     l_37C2_1688             ; Jump if above or =
  47.                 div     bx                      ; ax,dx rem=dx:ax/reg
  48.                 mov     bx,ax
  49.                 in      al,61h                  ; port 61h, 8255 port B, read
  50.                 test    al,3
  51.                 jnz     l_37C2_1680             ; Jump if not zero
  52.                 or      al,3
  53.                 out     61h,al                  ; port 61h, 8255 B - spkr, etc
  54.                 mov     al,0B6h
  55.                 out     43h,al                  ; port 43h, 8253 wrt timr mode
  56. l_37C2_1680:                                    ;  xref 37C2:1676
  57.                 mov     al,bl
  58.                 out     42h,al                  ; port 42h, 8253 timer 2 spkr
  59.                 mov     al,bh
  60.                 out     42h,al                  ; port 42h, 8253 timer 2 spkr
  61. l_37C2_1688:                                    ;  xref 37C2:166C
  62.                 pop     bp
  63.                 retn
  64. Sound   endp
  65.  
  66.  
  67. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  68. ;                              SUBROUTINE
  69. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  70.  
  71. NoSound proc    near
  72.                 in      al,61h                  ; port 61h, 8255 port B, read
  73.                 and     al,0FCh
  74.                 out     61h,al                  ; port 61h, 8255 B - spkr, etc
  75.                                                 ;  al = 0, disable parity
  76.                 retn
  77. NoSound endp
  78.  
  79.  
  80. --- PPoint 1.37
  81.  * Origin: Ward-B (SoCal) - (909) 793-xxxx - Pvt (1:207/213.5)
  82. SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
  83. SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 261/1023
  84. SEEN-BY: 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20
  85.